Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak debug logs in SocketModeClient #1624

Merged
merged 1 commit into from
May 10, 2023

Conversation

seratch
Copy link
Member

@seratch seratch commented May 9, 2023

Summary

This pull request improves the minor error in debug logs inside SocketModeClient:

[DEBUG]  socket-mode:SocketModeClient:0 Calling ack() - type: slash_commands, envelope_id: 93d32efc-f8b5-47d6-9350-a794d90bea7f, data: [object Object]

data: [object Object]

The above part does not provide meaningful information.

Requirements (place an x in each [ ])

@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:socket-mode applies to `@slack/socket-mode` labels May 9, 2023
@seratch seratch added this to the socket-mode@1.4.0 milestone May 9, 2023
@seratch seratch self-assigned this May 9, 2023
@@ -742,7 +742,9 @@ export class SocketModeClient extends EventEmitter {

// Define Ack
const ack = async (response: Record<string, unknown>): Promise<void> => {
this.logger.debug(`Calling ack() - type: ${event.type}, envelope_id: ${event.envelope_id}, data: ${response}`);
if (this.logger.getLevel() === LogLevel.DEBUG) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this if statement to avoid JSON.stringify when the log level is not DEBUG

@seratch seratch merged commit 816aad0 into slackapi:main May 10, 2023
5 checks passed
@seratch seratch deleted the socket-mode-debug-log branch May 10, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:socket-mode applies to `@slack/socket-mode`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants